package timeUtils

import "time"

var (
	TimeLayoutDate     = "2006-01-02"
	TimeLayoutDateTime = "2006-01-02 15:04:05"
)

func NowUnix() int64 {
	return time.Now().Unix()
}

func NowDateStr() string {
	return time.Now().Format(TimeLayoutDate)
}
func NowDateTimeStr() string {
	return time.Now().Format(TimeLayoutDateTime)
}

func StrToDate(dt string) (time.Time, error) {
	return time.Parse(TimeLayoutDate, dt)
}

func StrToDateTime(dt string) (time.Time, error) {
	return time.Parse(TimeLayoutDateTime, dt)
}
